﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace CodeCamp.Models.Schedule
{
    public class RoomEditModel
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(128)]
        public string Name { get; set; }

        [Required]
        public int Capacity { get; set; }

        public Nullable<int> Floor { get; set; }

        [Required]
        public bool ShowToPublic { get; set; }

        public string SimpleRoomSummary
        {
            get
            {
                StringBuilder roomSummary = new StringBuilder();
                roomSummary.AppendFormat("{0} (seats {1})", Name, Capacity);
                if (Floor.HasValue)
                    roomSummary.AppendFormat(" Floor: {0}", Floor);
                if (!ShowToPublic)
                    roomSummary.Append(" (not public)");
                return roomSummary.ToString();
            }
        }
    }
}